package com.atguigu.jinx.mapper;

import com.atguigu.jinx.entity.dto.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author steve
 * @since 2025-08-07
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Insert("INSERT INTO suggestion (usr_suggestion, contact_way, create_datetime) " +
            "VALUES (#{usrSuggestion}, #{contactWay}, NOW())")
    int insertSuggestion(@Param("usrSuggestion") String usrSuggestion,@Param("contactWay") String contactWay);


    @Select("SELECT COUNT(*) FROM suggestion WHERE contact_way = #{contactWay}")
    Integer selectSuggestion(String contactWay);
}
